package com.itheima.service.impl;

import com.itheima.dao.AccountDao;
import com.itheima.domain.UserAccount;
import com.itheima.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service("accountService")
public class AccountServiceImpl implements AccountService {
    @Autowired
    private AccountDao accountDao;

    // 1、查询行程表中所有的数据
    @Override
    public List<UserAccount> queryAllInfo(){
      return  accountDao.queryallinfo();

    }
    // 2、添加用户过年的形成数据


    //3、根据ID查询用户的行程数据
    @Override
    public UserAccount findById(Integer id){
        UserAccount user= accountDao.findById(id);
        return user;
    }

    //4、根据ID修改用户的行程数据
    @Override
    public int updateById(Integer id, String startAddr, String toAddr){
        int row= accountDao.updateById(id,startAddr,toAddr);
        return row;
    }
    //5、根据ID删除用户的行程数据
    @Override
    public int deleteByid(Integer id) {
      int row= accountDao.deleteByid(id);
        return row;

    }



}
